1. Field of Invention
The present invention generally relates to Literate Programming. The method and apparatus of the present invention have particular application to automatic generation of software documentation.
2. Discussion of Prior Art
The support and maintenance of large, complex software applications are made much simpler by embedding documentation and explanatory comments in the application""s source code. The concept of xe2x80x9cLiterate Programmingxe2x80x9d is a big effort in this area. Its proponents advocate a system where a program""s source code and comments read almost like a technical journal article.
In Literate Programming, software tools are used to automatically generate documentation from a program""s source code file, a process known as weaving. With the recent pervasiveness of the Internet, much effort has been applied to create methods to automatically generate browsable documentation which takes advantage of hyperlinking and other HTML properties.
The prior art, discussed below, describes different methods of parsing source code to generate documentation or additional code automatically.
The patent to Brisson (U.S. Pat. No. 5,678,052) provides an automated translation method between high level programming languages. This reference focuses on maintaining valid pre-processor constructs between the different translations.
The patent to De Bonet (U.S. Pat. No. 5,905,894) teaches extending programming language precompiler directive functionality to support the passing of code segments as arguments to other functions at compile time. The goal is to improve run-time performance and does not involve documentation generation.
The patent to Takeuchi (U.S. Pat. No. 5,526,522) teaches automatic programming generation which converts a specification document into a syntactic tree and then recursively creates source code.
The patent to Andres et al. (U.S. Pat. No. 5,768,564) provides for a grammar converter which parses a text-based BNF grammar and produces a compressed xe2x80x9crail-roadxe2x80x9d diagram.
Two Literate Programming tools presently available are NuWeb(TM) and FunnelWeb(TM). They are language independent pre-processors and can produce documentation in HTML according to macro definitions in user programs.
Javadoc is a standard tool of a Java compiler that parses the declarations and comments in a set of Java source files and produces a set of HTML pages describing the files"" classes, interfaces, methods and fields. Typically, for each class, a single HTML document is generated.
Whatever the precise merits and features of the prior art in this field, the earlier art does not achieve or fulfill the purposes of the present invention. The prior art does not provide for automatically generating documentation for an object-oriented application which enables cross-linking between the different classes.
In the present invention, documentation of a software application is automatically generated for the classes, written in an object oriented-language, which comprise the application. The classes within the application are typically arranged in a hierarchy and contain productions of a specification grammar in Extended Backus Naur form. The automatically generated documentation corresponding to these productions is closely wired to the underlying class hierarchy by creating hypertext links between the productions in different classes. Thus, these generated hyperlinks allow browsing of the automatically generated documentation according to the hierarchical structure of the classes in the object-oriented class hierarchy being documented.